package com.szxy.item.service.impl;

import com.codingapi.txlcn.tc.annotation.LcnTransaction;
import com.netflix.discovery.converters.Auto;
import com.szxy.item.service.ItemDescService;
import com.szxy.mapper.TbItemDescMapper;
import com.szxy.pojo.TbItemDesc;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Auther:zwer
 * @Date:2019/9/7 19:54
 * @Description:com.szxy.item.service.impl
 * @Version:1.0
 **/
@Service
public class ItemDescServiceImpl implements ItemDescService {

    @Autowired
    private TbItemDescMapper itemDescMapper;

    @Override
    @LcnTransaction
    public Integer insertItemDesc(TbItemDesc itemDesc) {
        return this.itemDescMapper.insert(itemDesc);
    }

    @Override
    @LcnTransaction
    public int updateItemDescByItemId(TbItemDesc itemDesc) {
        // TODO: 2019/9/9
        //更新商品描述 desc ，属于大字段
        System.out.println("itemDesc:"+itemDesc);
        return this.itemDescMapper.updateByPrimaryKeyWithBLOBs(itemDesc);
    }

    @Override
    public TbItemDesc findItemDescByItemId(Long itemId) {
        // TODO: 2019/9/9
        return this.itemDescMapper.selectByPrimaryKey(itemId);
    }
}
